package org.amicofragile.bank;

public class Account {
	private Long id;
	private Person owner;
	private Double amount;
	
	public Account(Long id, Person owner, Double amount) {
		this.id = id;
		this.owner = owner;
		this.amount = amount;
	}
	
	public Account(Long id, Person owner) {
		this(id, owner, 0.0);
	}

	public Long getId() {
		return id;
	}

	public Person getOwner() {
		return owner;
	}

	public Double getAmount() {
		return amount;
	}
	
	public void deposit(Double howMuch) {
		this.amount += howMuch;
	}
	
	public void withdraw(Double howMuch) {
		this.amount -= howMuch;
	}
	
	@Override
	public String toString() {
		return String.format("<%d>", id);
	}
}
